<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>商品信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../elementUI/index.css">
    <link rel="stylesheet" href="../../../css/index.css">
</head>

<body>
    <div id="app" class="minWidth">
        <el-form :inline="true" :form="form" @submit.native.prevent>
            <el-form-item>
                <el-button type="primary" @click="handleBatchAdd">批量选品</el-button>
            </el-form-item>
            <el-form-item>
                <el-input v-model.trim="form.Article_Name" @change="onSerach" placeholder="请输入商品名称" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSerach">查询</el-button>
            </el-form-item>
            <!-- <el-form-item>
                <el-switch @change="onSerach" v-model="form.PriceType" active-text="仅查看有结算价商品"></el-switch>
            </el-form-item> -->
            <el-form-item>
                <el-switch @change="onSerach" v-model="form.Selected" active-text="仅查看已选商品"></el-switch>
            </el-form-item>
        </el-form>

        <el-table :data="tableData" stripe border height="calc(100vh - 140px)" @selection-change="handleSelectionChange"
            style="width: 100%">
            <el-table-column align="center" type="selection" :selectable="selectable"  width="40"></el-table-column>
            <el-table-column align="center" label="序号" width="50" type="index"></el-table-column>
            <el-table-column align="center" prop="Article_SerialNumber" label="商品流水号">
                <template v-slot="{row}">
                    {{row.Article_SerialNumber.substring(0,row.Article_SerialNumber.lastIndexOf('-'))}}
                </template>
            </el-table-column>
            <el-table-column align="center" label="商品图片" width="125">
                <template v-slot="{row}">
                    <el-image style="width: 100px; height: 100px;" :src="DomainIMG + row.Picture_URL"  fit="contain"></el-image>
                </template>
            </el-table-column>
            <el-table-column align="center" prop="Article_Name" label="商品名"></el-table-column>
            <el-table-column align="center" prop="Unit_Price" label="吊牌价" label="结算价"></el-table-column>
            <el-table-column align="center" prop="Balance_Unit_Price" label="结算价"></el-table-column>
            <el-table-column align="center" prop="Daily_Supply" label="日供应"></el-table-column>
            <el-table-column align="center" prop="Enterprise_Name" label="所属企业"></el-table-column>
            <el-table-column align="center" label="操作" width="120">
                <template v-slot="{row}">
                    <el-button :type="row.Selected_SerialNumber==''?'success':'danger'" size="small" @click="handleAdd(row)">
                        {{row.Selected_SerialNumber==''?'选品':'取消已选'}}
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination background @size-change="handleSizeChange"
            @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10, 20, 30, 50]"
            :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
    </div>
    <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../js/vue.min.js"></script>
    <script type="text/javascript" src="../../../elementUI/index.js"></script>
    <script type="text/javascript" src="../../../js/utils.js"></script>
    <script type="text/javascript" src="./js/GoodsPool.js"></script>
</body>

</html>